<!DOCTYPE html>
<html>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0">
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<head>
		<title>{$Think.config.system_name}</title>
		<link rel="stylesheet" href="__ASSETS__/css/style.css">
		<script src="__ASSETS__/js/jquery.min.js"></script>
	</head>
	<body>
		<h1>{$Think.config.system_name}</h1>
		<div class="w3layouts">
			<div class="signin-agile">
				<h2>登录</h2>
				<form onsubmit="return false;">
					<input type="text" name="username" class="name" placeholder="请输入用户名" required="">
					<input type="password" name="passwd" class="password" placeholder="请输入密码" required="">
					<div class="clear"></div>
					<input id="submit" type="submit" value="登录">
				</form>
			</div>
			<div class="clear"></div>
		</div>
	</body>
</html>
<script>
	$(function(){
		$("#submit").click(function(){
			var cont = {username:$("input")[0].value,passwd:$("input")[1].value};
			$.ajax({
				url:"{:U('passport/checkLogin')}",
				type:'post',
				dataType:'json',
				data:cont,
				success:function(data){
					if(data.code==0){
						alert(data.message);
					}else{
						window.location.href="{:U('/Admin/index')}";
					}
				}
			});
		});
	});
</script>